package com.itheima.mapper;

import com.itheima.DTO.SysMenuDTO;
import com.itheima.VO.MenuVO;
import com.itheima.entity.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysMenuMapper {
    List<SysMenu> selectMenuInfoByRoleId(List<String> roleIds);

    List<SysMenu> selectChildrenListByPid(int i);

    void insertSysMenu(SysMenu sysMenu);

    void deleteSysMenuById(Integer id);

    Integer selectSysMenuCountById(Integer id);

    SysMenu selectSysMenuById(Integer id);

    void updateSysMenuById(SysMenuDTO sysMenuDTO);

    @Select("select id, pid, path, component, title, icon, is_show, is_cache, is_link, redirect, create_date, update_date, del_flag, type, sort, mark, default_data" +
            " from sys_menu")
    List<SysMenu> selectAll();

    List<MenuVO> selectMenuByMenuId(List<Integer> menuIds);

}
